Ext.define('PJ.view.codtrainingprogram.UnitsIssuedList', {
    extend: 'AM.default.DefaultList',
    alias: ['widget.coprunitsIssuedList'],
    requires: [],
    isHavePage: false,
    initComponent: function(){
    	var me= this;
    	var alignStr = "left";
    	var issuedTime = {
    			width: 0
    	};
    	if(me.isView){
    		me.selModel= {
    	        selType: '',
    	        // 设置为只能通过复选框选中行
    	        checkOnly: true
    	    };
    		alignStr = "center";
    		w = 0;
    		issuedTime = {
    	        	header: '下发时间',
    	        	dataIndex: 'createDateStr',
    	            width: 110,
    	            align: alignStr,
    	    		renderer: function(value, metaData, record){
    	    			return value;
    	    		}
    	        };
    	}
    	this.columns = [{
            header: '单位名称',
            dataIndex: 'deptName',
            flex: 1,
            align: alignStr,
    		renderer: function(value, metaData, record,rowIndex){
    			metaData.tdAttr = 'data-qtip="' + value + '"';
//    			if (record.get("selectState") == 1) {
//                    this.getSelectionModel().selectRange(rowIndex,rowIndex,true);//根据需求默认选中当前数据
//                }
    			return value;
    		}
        },issuedTime];
    	
        this.store = Ext.create('PJ.'+ prototype +'.codtrainingprogram.UnitsIssuedList',{
        	isLoad: false
        });
        this.callParent(arguments);
        this.loadType = gj_onlineLearning_constant.loadType;//加载方式
    },
    listeners: {
		viewready: function(){
			var me = this;
			var store = this.store;
            var params = store.proxy.extraParams;
            var newParams = {
            		searchPlanId: me.planId
            };
            Ext.apply(params, newParams);
            store.isLoad = true;
            store.load();
            // 触发权限过滤事件
            me.fireEvent("permission", this);
		}
    }
});
